package demoMod.stsconsole.powers;

import demoMod.stsconsole.ConsoleEntry;
import demoMod.stsconsole.characters.AbstractPlayer;
import demoMod.stsconsole.core.AbstractCreature;
import demoMod.stsconsole.interfaces.PreDrawSubscriber;
import demoMod.stsconsole.interfaces.TurnEndSubscriber;

public class NoDrawPower extends AbstractPower implements PreDrawSubscriber, TurnEndSubscriber {
    public static final String ID = "NoDrawPower";

    public NoDrawPower(AbstractCreature owner) {
        super(ID, owner, new int[0]);
        this.type = PowerType.DEBUFF;
    }

    @Override
    public String getUpdatedDescriptions() {
        return this.description;
    }

    @Override
    public int beforeCardDraw(int amount, boolean isTurnStart) {
        if (this.owner instanceof AbstractPlayer) {
            this.owner.talk(powerStrings.get(2));
        }
        return this.owner instanceof AbstractPlayer ? 0 : amount;
    }

    @Override
    public void atEndOfTurn(boolean isPlayer) {
        if (isPlayer && !ConsoleEntry.removeLater.contains(this)) {
            this.onRemove();
        }
    }
}
